Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to create bulk impression tracker via the CM360 APi! #1214

Open
daeexxe opened this issue May 14, 2024 · 0 comments
Open

I want to create bulk impression tracker via the CM360 APi! #1214

daeexxe opened this issue May 14, 2024 · 0 comments

Comments

@daeexxe
Copy link

daeexxe commented May 14, 2024

To whom this will concern,

I am having trouble bulk creating and assigning impression trackers as 1x1 pixels. I have included an example of the code I have written below:

function _createOneTrackingCreative(ss, singleTrackingCreativeArray){
  var profileID = _fetchProfileId();
 
  var advertiserId = singleTrackingCreativeArray[0];
  var campaignId = singleTrackingCreativeArray [1]
  var name = singleTrackingCreativeArray[2];
  var width = singleTrackingCreativeArray[3];
  var height = singleTrackingCreativeArray[4];
  var creativeType = singleTrackingCreativeArray[5];
 
  var creativeResource =  {
    "name": name,
    "advertiserId": advertiserId,
    "campaignId" : campaignId,
    "size": {
      "width": width,
      "height": height
    },
    "active": true,
    "type": creativeType,
 
  }
 
  for (var i = 1; i < values.length; i++) { // exclude header row
    var newCreative = _createOneTrackingCreative(ss, values[i]);
    var rowNum = i+1;
    sheet.getRange('H' + rowNum)
        .setValue(newCreative.id)
        .setBackground('lightgray');
 
    var newTrackingCreative = DoubleClickCampaigns.Creatives
     .insert(TrackingcreativeResource, profileID);
  return newTrackingCreative;
   
  }
 
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@daeexxe and others