Moments
JS SDK (for Websites)
Google Ad Manager (GAM)
9min
introduction this guide simplifies the integration of momentscience with google ad manager (gam) follow these steps for a quick and effective setup to enhance your website's advertising capabilities requirements your js sdk snippet (obtainable through the dashboard ) access to your google tag manager account information on the page link/url structure where you'll display the momentscience unit (e g , order confirmation page) steps overview navigate to google ad manager and select delivery > creatives under display creatives, click "new creative " choose your advertiser and select "third party " enter a name for your creative (e g , momentscience – banner – 1x1 1 ) set the target ad unit size size to 1x1 for universal compatibility select "standard" for the code type and paste the js sdk snippet save your settings for additional guidance on setting up third party creatives, refer to this google ad manager support article passing payload values (optional) to pass payload values with a gam driven implementation of momentscience , you have two options declare the payload object before loading momentscience via gam set payload values and refresh the momentscience unit afterward option 1 declare payload object before loading momentscience via gam determine the payload values you want to pass use the following code snippet to pass your payload, just replace the customattribute with the desired attribute(s) and value(s) passing payload values // set a new payload attribute "customattribute" with value 'somevalue' window\ adpxuser = object assign(window\ adpxuser || {}, { "customattribute" 'somevalue' }); to set multiple payload attributes at once, use passing multiple payload attributes once window\ adpxuser = object assign(window\ adpxuser || {}, { "attributeone" 1, "attributetwo" 3 41, "customattribute" 'newvalue' }); when a payload attribute is set, it overwrites any existing value for that attribute for example, if both snippets are used, the final value for the payload attribute " customattribute " would be set to " newvalue " option 2 set payload values after momentscience initialization via gam to set payload values after momentscience is initialized via gam, follow these steps modify the moments js sdk snippet to prevent momentscience from loading on initialization by setting autoload false this allows payload values to be added on page load to launch the unit and refresh/display it with the updated payload values, call window\ adpx refresh() the momentscience js sdk snippet provided displays momentscience at run time by default to delay its display and add payload values on page load, set autoload false afterwards, you can launch the unit with the updated payload values by calling window\ adpx refresh() 📢 if you're running into any issues while going through the integration process, feel free to contact us at help\@momentscience com